package com.caiyouxi.finance.controller;

import com.caiyouxi.common.bean.ResData;
import com.caiyouxi.common.control.BaseController;
import com.caiyouxi.finance.model.FinanceCurrency;
import com.caiyouxi.finance.service.FinanceCurrencyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/finance_currency")
public class FinanceCurrencyController extends BaseController{
    @Autowired
    private FinanceCurrencyService service;
    /**
     * 获取单条信息
     * */
    @RequestMapping("/get_finance_currency")
    public ResData get_finance_currency(@RequestBody FinanceCurrency bean){
        return success(service.get_finance_currency_by_code(bean.getCode()));
    }
    /**
     * 获取所有信息
     */
    @RequestMapping("/finance_currency_list")
    public ResData finance_currency_list(@RequestBody FinanceCurrency bean){
        return success(service.finance_currency_list(bean));
    }
    /**
     * 添加信息
     * */
    @RequestMapping("add_finance_currency")
    public ResData add_finance_currency(@RequestBody FinanceCurrency bean){
         return service.add_finance_currency(bean);
    }
}
